package javase;

/**
 * 测试类加载和实例化顺序
 *
 * @author hck
 */
public class ClassInstance {
    private static final Node NODE1 = new Node("初始化静态final实例");
    private static Node NODE2 = new Node("初始化静态非final实例");
    private static Node NODE3;
    private Node NODE4 = new Node("初始化非静态实例");
    private Node NODE5;

    static {
        NODE3 = new Node("初始化静态代码块实例");
    }

    public ClassInstance() {
        NODE5 = new Node("构造器初始化实例");
    }
}


class Node {
    static {
        System.out.println("node static");
    }

    public Node(String msg) {
        System.out.println(msg);
    }
}
